<?php

namespace app\index\controller;

use coser\Controller;
use app\index\model\ClockModel;

class Clock extends Controller
{

	public function addClock()
	{
        $data = $_POST;

        $time = $data['year'] .'/'.$data['month'] .'/'.$data['day'] .' '.$data['huor'].':'.$data['minute'].':00';
        $info = [
            'uid'=> 1,
            'title' => $data['title'],
            'start_time' => strtotime($time),
            'audio_id' => $data['audio_id'],
            'create_time' => time(),
        ];

        $menuModel = new ClockModel();
		$menuModel->add($info);

		return ajaxReturn(['code'=>200,'msg'=>'添加成功']);
	}

}